﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Sistema_de_Taller.SDT_UI.Vehicle
{
    public partial class vehicle_default : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnCreateVehicle_Click(object sender, EventArgs e)
        {

            MessageOk.Visible = false;
            Common_Files.Definitions.Vehicle Vehicle = new Common_Files.Definitions.Vehicle();

            Vehicle.Vehicle_Brand = txtBrand.Text;
            Vehicle.Vehicle_Model = txtModel.Text;
            Vehicle.Vehicle_Patent = txtPatent.Text;
            Vehicle.Vehicle_EngineNumber = txtEngineNumber.Text;
            Vehicle.Vehicle_SerialNumber = Convert.ToUInt32(txtSerialNumber.Text);
            Vehicle.Vehicle_SellDate = dpSellDate.SelectedDate.Value;
            SDT_BS.Vehicle_BS vehicleBS = new SDT_BS.Vehicle_BS();
            if (vehicleBS.validate(Vehicle))
            {

            }

            lblMessages.Text = "Vehiculo cargado satisfactoriamente";
            MessageOk.Visible = true;
        }

        protected void dpSellDate_Load(object sender, EventArgs e)
        {
            dpSellDate.SelectedDate = DateTime.Today;
        }
    }
}